<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>BOMInputStream (Apache Commons IO 2.5 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="BOMInputStream (Apache Commons IO 2.5 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BOMInputStream.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/io/input/AutoCloseInputStream.html" title="class in org.apache.commons.io.input"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/io/input/BoundedInputStream.html" title="class in org.apache.commons.io.input"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/io/input/BOMInputStream.html" target="_top">Frames</a></li>
<li><a href="BOMInputStream.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields_inherited_from_class_java.io.FilterInputStream">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.io.input</div>
<h2 title="Class BOMInputStream" class="title">Class BOMInputStream</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">java.io.InputStream</a></li>
<li>
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/io/FilterInputStream.html?is-external=true" title="class or interface in java.io">java.io.FilterInputStream</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">org.apache.commons.io.input.ProxyInputStream</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.io.input.BOMInputStream</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">BOMInputStream</span>
extends <a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></pre>
<div class="block">This class is used to wrap a stream that includes an encoded <a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io"><code>ByteOrderMark</code></a> as its first bytes.
 
 This class detects these bytes and, if required, can automatically skip them and return the subsequent byte as the
 first byte in the stream.
 
 The <a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io"><code>ByteOrderMark</code></a> implementation has the following pre-defined BOMs:
 <ul>
 <li>UTF-8 - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_8"><code>ByteOrderMark.UTF_8</code></a></li>
 <li>UTF-16BE - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_16LE"><code>ByteOrderMark.UTF_16LE</code></a></li>
 <li>UTF-16LE - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_16BE"><code>ByteOrderMark.UTF_16BE</code></a></li>
 <li>UTF-32BE - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_32LE"><code>ByteOrderMark.UTF_32LE</code></a></li>
 <li>UTF-32LE - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_32BE"><code>ByteOrderMark.UTF_32BE</code></a></li>
 </ul>
 
 
 <h3>Example 1 - Detect and exclude a UTF-8 BOM</h3>
 
 <pre>
 BOMInputStream bomIn = new BOMInputStream(in);
 if (bomIn.hasBOM()) {
     // has a UTF-8 BOM
 }
 </pre>
 
 <h3>Example 2 - Detect a UTF-8 BOM (but don't exclude it)</h3>
 
 <pre>
 boolean include = true;
 BOMInputStream bomIn = new BOMInputStream(in, include);
 if (bomIn.hasBOM()) {
     // has a UTF-8 BOM
 }
 </pre>
 
 <h3>Example 3 - Detect Multiple BOMs</h3>
 
 <pre>
 BOMInputStream bomIn = new BOMInputStream(in, 
   ByteOrderMark.UTF_16LE, ByteOrderMark.UTF_16BE,
   ByteOrderMark.UTF_32LE, ByteOrderMark.UTF_32BE
   );
 if (bomIn.hasBOM() == false) {
     // No BOM found
 } else if (bomIn.hasBOM(ByteOrderMark.UTF_16LE)) {
     // has a UTF-16LE BOM
 } else if (bomIn.hasBOM(ByteOrderMark.UTF_16BE)) {
     // has a UTF-16BE BOM
 } else if (bomIn.hasBOM(ByteOrderMark.UTF_32LE)) {
     // has a UTF-32LE BOM
 } else if (bomIn.hasBOM(ByteOrderMark.UTF_32BE)) {
     // has a UTF-32BE BOM
 }
 </pre></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>2.0</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: BOMInputStream.java 1686527 2015-06-20 06:31:39Z krosenvold $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io"><code>ByteOrderMark</code></a>, 
<a href="http://en.wikipedia.org/wiki/Byte_order_mark">Wikipedia - Byte Order Mark</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_java.io.FilterInputStream">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;java.io.<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FilterInputStream.html?is-external=true" title="class or interface in java.io">FilterInputStream</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/FilterInputStream.html?is-external=true#in" title="class or interface in java.io">in</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#BOMInputStream(java.io.InputStream)">BOMInputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate)</code>
<div class="block">Constructs a new BOM InputStream that excludes a <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_8"><code>ByteOrderMark.UTF_8</code></a> BOM.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#BOMInputStream(java.io.InputStream,%20boolean)">BOMInputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate,
              boolean&nbsp;include)</code>
<div class="block">Constructs a new BOM InputStream that detects a a <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_8"><code>ByteOrderMark.UTF_8</code></a> and optionally includes it.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#BOMInputStream(java.io.InputStream,%20boolean,%20org.apache.commons.io.ByteOrderMark...)">BOMInputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate,
              boolean&nbsp;include,
              <a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>...&nbsp;boms)</code>
<div class="block">Constructs a new BOM InputStream that detects the specified BOMs and optionally includes them.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#BOMInputStream(java.io.InputStream,%20org.apache.commons.io.ByteOrderMark...)">BOMInputStream</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate,
              <a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>...&nbsp;boms)</code>
<div class="block">Constructs a new BOM InputStream that excludes the specified BOMs.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#getBOM()">getBOM</a></strong>()</code>
<div class="block">Return the BOM (Byte Order Mark).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#getBOMCharsetName()">getBOMCharsetName</a></strong>()</code>
<div class="block">Return the BOM charset Name - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#getCharsetName()"><code>ByteOrderMark.getCharsetName()</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#hasBOM()">hasBOM</a></strong>()</code>
<div class="block">Indicates whether the stream contains one of the specified BOMs.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#hasBOM(org.apache.commons.io.ByteOrderMark)">hasBOM</a></strong>(<a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>&nbsp;bom)</code>
<div class="block">Indicates whether the stream contains the specified BOM.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#mark(int)">mark</a></strong>(int&nbsp;readlimit)</code>
<div class="block">Invokes the delegate's <code>mark(int)</code> method.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#read()">read</a></strong>()</code>
<div class="block">Invokes the delegate's <code>read()</code> method, detecting and optionally skipping BOM.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#read(byte[])">read</a></strong>(byte[]&nbsp;buf)</code>
<div class="block">Invokes the delegate's <code>read(byte[])</code> method, detecting and optionally skipping BOM.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#read(byte[],%20int,%20int)">read</a></strong>(byte[]&nbsp;buf,
    int&nbsp;off,
    int&nbsp;len)</code>
<div class="block">Invokes the delegate's <code>read(byte[], int, int)</code> method, detecting and optionally skipping BOM.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#reset()">reset</a></strong>()</code>
<div class="block">Invokes the delegate's <code>reset()</code> method.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/io/input/BOMInputStream.html#skip(long)">skip</a></strong>(long&nbsp;n)</code>
<div class="block">Invokes the delegate's <code>skip(long)</code> method, detecting and optionallyskipping BOM.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.io.input.ProxyInputStream">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.commons.io.input.<a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></h3>
<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#afterRead(int)">afterRead</a>, <a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#available()">available</a>, <a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#beforeRead(int)">beforeRead</a>, <a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#close()">close</a>, <a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#handleIOException(java.io.IOException)">handleIOException</a>, <a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#markSupported()">markSupported</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="BOMInputStream(java.io.InputStream)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BOMInputStream</h4>
<pre>public&nbsp;BOMInputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate)</pre>
<div class="block">Constructs a new BOM InputStream that excludes a <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_8"><code>ByteOrderMark.UTF_8</code></a> BOM.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>delegate</code> - the InputStream to delegate to</dd></dl>
</li>
</ul>
<a name="BOMInputStream(java.io.InputStream, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BOMInputStream</h4>
<pre>public&nbsp;BOMInputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate,
              boolean&nbsp;include)</pre>
<div class="block">Constructs a new BOM InputStream that detects a a <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#UTF_8"><code>ByteOrderMark.UTF_8</code></a> and optionally includes it.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>delegate</code> - the InputStream to delegate to</dd><dd><code>include</code> - true to include the UTF-8 BOM or false to exclude it</dd></dl>
</li>
</ul>
<a name="BOMInputStream(java.io.InputStream, org.apache.commons.io.ByteOrderMark...)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>BOMInputStream</h4>
<pre>public&nbsp;BOMInputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate,
              <a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>...&nbsp;boms)</pre>
<div class="block">Constructs a new BOM InputStream that excludes the specified BOMs.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>delegate</code> - the InputStream to delegate to</dd><dd><code>boms</code> - The BOMs to detect and exclude</dd></dl>
</li>
</ul>
<a name="BOMInputStream(java.io.InputStream, boolean, org.apache.commons.io.ByteOrderMark...)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BOMInputStream</h4>
<pre>public&nbsp;BOMInputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;delegate,
              boolean&nbsp;include,
              <a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>...&nbsp;boms)</pre>
<div class="block">Constructs a new BOM InputStream that detects the specified BOMs and optionally includes them.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>delegate</code> - the InputStream to delegate to</dd><dd><code>include</code> - true to include the specified BOMs or false to exclude them</dd><dd><code>boms</code> - The BOMs to detect and optionally exclude</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="hasBOM()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasBOM</h4>
<pre>public&nbsp;boolean&nbsp;hasBOM()
               throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Indicates whether the stream contains one of the specified BOMs.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>true if the stream has one of the specified BOMs, otherwise false if it does not</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error reading the first bytes of the stream occurs</dd></dl>
</li>
</ul>
<a name="hasBOM(org.apache.commons.io.ByteOrderMark)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasBOM</h4>
<pre>public&nbsp;boolean&nbsp;hasBOM(<a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>&nbsp;bom)
               throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Indicates whether the stream contains the specified BOM.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bom</code> - The BOM to check for</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the stream has the specified BOM, otherwise false if it does not</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the BOM is not one the stream is configured to detect</dd>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error reading the first bytes of the stream occurs</dd></dl>
</li>
</ul>
<a name="getBOM()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBOM</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/commons/io/ByteOrderMark.html" title="class in org.apache.commons.io">ByteOrderMark</a>&nbsp;getBOM()
                     throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Return the BOM (Byte Order Mark).</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The BOM or null if none</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error reading the first bytes of the stream occurs</dd></dl>
</li>
</ul>
<a name="getBOMCharsetName()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBOMCharsetName</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getBOMCharsetName()
                         throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Return the BOM charset Name - <a href="../../../../../org/apache/commons/io/ByteOrderMark.html#getCharsetName()"><code>ByteOrderMark.getCharsetName()</code></a>.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The BOM charset Name or null if no BOM found</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error reading the first bytes of the stream occurs</dd></dl>
</li>
</ul>
<a name="read()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public&nbsp;int&nbsp;read()
         throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Invokes the delegate's <code>read()</code> method, detecting and optionally skipping BOM.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#read()">read</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>the byte read (excluding BOM) or -1 if the end of stream</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
</li>
</ul>
<a name="read(byte[], int, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public&nbsp;int&nbsp;read(byte[]&nbsp;buf,
       int&nbsp;off,
       int&nbsp;len)
         throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Invokes the delegate's <code>read(byte[], int, int)</code> method, detecting and optionally skipping BOM.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#read(byte[],%20int,%20int)">read</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>buf</code> - the buffer to read the bytes into</dd><dd><code>off</code> - The start offset</dd><dd><code>len</code> - The number of bytes to read (excluding BOM)</dd>
<dt><span class="strong">Returns:</span></dt><dd>the number of bytes read or -1 if the end of stream</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
</li>
</ul>
<a name="read(byte[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public&nbsp;int&nbsp;read(byte[]&nbsp;buf)
         throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Invokes the delegate's <code>read(byte[])</code> method, detecting and optionally skipping BOM.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#read(byte[])">read</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>buf</code> - the buffer to read the bytes into</dd>
<dt><span class="strong">Returns:</span></dt><dd>the number of bytes read (excluding BOM) or -1 if the end of stream</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
</li>
</ul>
<a name="mark(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mark</h4>
<pre>public&nbsp;void&nbsp;mark(int&nbsp;readlimit)</pre>
<div class="block">Invokes the delegate's <code>mark(int)</code> method.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#mark(int)">mark</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>readlimit</code> - read ahead limit</dd></dl>
</li>
</ul>
<a name="reset()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre>public&nbsp;void&nbsp;reset()
           throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Invokes the delegate's <code>reset()</code> method.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#reset()">reset</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
</li>
</ul>
<a name="skip(long)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>skip</h4>
<pre>public&nbsp;long&nbsp;skip(long&nbsp;n)
          throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Invokes the delegate's <code>skip(long)</code> method, detecting and optionallyskipping BOM.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html#skip(long)">skip</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/io/input/ProxyInputStream.html" title="class in org.apache.commons.io.input">ProxyInputStream</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - the number of bytes to skip</dd>
<dt><span class="strong">Returns:</span></dt><dd>the number of bytes to skipped or -1 if the end of stream</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O error occurs</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/BOMInputStream.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/io/input/AutoCloseInputStream.html" title="class in org.apache.commons.io.input"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/io/input/BoundedInputStream.html" title="class in org.apache.commons.io.input"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/io/input/BOMInputStream.html" target="_top">Frames</a></li>
<li><a href="BOMInputStream.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields_inherited_from_class_java.io.FilterInputStream">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
